﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BOHVote.DAL;

namespace BOHVote.BLL
{
    public static class ReportClass
    {
        public static DataSet dstSubjectApply(string strApplyPeriod, string strAccreditationLevel)
        { 
            ReportProvide rp = new ReportProvide();
            DataSet dst = rp.ReportSubjectApply(strApplyPeriod, strAccreditationLevel);

            return dst;
        }

        public static DataSet dstUnitApply(string strApplyPeriod, string GovernID)
        {
            ReportProvide rp = new ReportProvide();
            DataSet dst = rp.ReportUnitApply(strApplyPeriod, GovernID);
            return dst;
        }

        public static DataSet dstGovernApply(string strApplyPeriod)
        {
            ReportProvide rp = new ReportProvide();
            DataSet dst = rp.ReportGovernApply(strApplyPeriod);

            return dst;
        }

        public static DataSet dstUnitHeightApply(string strApplyPeriod, string GovernID)
        {
            ReportProvide rp = new ReportProvide();
            DataSet dst = rp.ReportUnitHeightApply(strApplyPeriod, GovernID);

            return dst;
        }

        public static DataSet dstGovernHeightApply(string strApplyPeriod)
        {
            ReportProvide rp = new ReportProvide();
            DataSet dst = rp.ReportGovernHeightApply(strApplyPeriod);

            return dst;
        }

        public static DataSet dstSubjectHeightApply(string strApplyPeriod, string strAccreditationLevel)
        {
            ReportProvide rp = new ReportProvide();
            DataSet dst = rp.ReportSubjectHeightApply(strApplyPeriod, strAccreditationLevel);

            return dst;
        }

        public static DataSet dstSubjectApplyInfo(string subjectID,string strApplyPeriod,string strApplyPass)
        {
            DataSet dst = new DataSet();
            ReportProvide rp = new ReportProvide();
            DataSet dst12 = rp.ReportSubjectApplyInfo(subjectID,strApplyPeriod);
            if (!String.IsNullOrEmpty(strApplyPass) && strApplyPass != "-1")
            {
                DataRow[] drs = dst12.Tables[0].Select("PassInd='" + strApplyPass + "' ");
                DataTable dt = new DataTable();
                dt = dst12.Tables[0].Clone();
                foreach (DataRow dr in drs)
                {
                    dt.ImportRow(dr);
                }
                dst.Tables.Add(dt);
            }
            else
            {
                dst = dst12;
            }
            return dst;
        }

        public static DataSet dstSubjectHeightReportApply(string strApplyPeriod, string subjectID,string IsPassed)
        {
            ReportProvide rp = new ReportProvide();
            return rp.ReportSubjectHeightApply(strApplyPeriod, subjectID, IsPassed);
        }

        public static DataSet dstSubjectSReportApply(string strApplyPeriod, string subjectID, string IsPassed)
        {
            ReportProvide rp = new ReportProvide();
            return rp.ReportSubjectSApply(strApplyPeriod, subjectID, IsPassed);
        }

        public static DataSet dstSubjectApplyInfoBlank(string subjectID, string strApplyPeriod)
        {
            ReportProvide rp = new ReportProvide();
            return rp.ReportSubjectApplyInfoBlank(subjectID, strApplyPeriod);
        }
    }
}
